function $dome(id){
	
  return  document.getElementById(id);	
}
function dome_hidden(id){
  $dome(id).style.display = 'none';	
}

function dome_show(id){
   $dome(id).style.display = 'block';	
}
function top_search(thisObj){   // the Select above the Navigator
 thisObj.parentNode.className = 's_box_on';
 var thisinput = thisObj.getElementsByTagName("input");
 var thisul = thisObj.getElementsByTagName("ul");
 var thisli = thisul[0].getElementsByTagName("li");
 if(thisObj.id != "CoLeeSelect"){
  thisObj.id = "CoLeeSelect";
  thisObj.focus();
  thisul[0].style.display = "block";
  for(var i=0;i<thisli.length;i++){
   thisli[i].onmouseover = function(){
    for(var j=0;j<thisli.length;j++){
     if(thisli[j].className=='last_li')thisli[j].className = "last_li";
	   else if(thisli[j].className == 'last_li_on')thisli[j].className = 'last_li';
	     else thisli[j].className = "";
	 //jQuery(this).removeClass("li_on");
     }
	if(this.className=="last_li")this.className = "last_li_on";
	   else if(this.className == 'last_li_on')this.className = 'last_li';
	      else  this.className = "li_on";
	//jQuery(this).addClass("li_on");
    }
   thisli[i].onclick = function(){
    if(this.innerText)thisinput[0].value = this.innerText;
	if(this.textContent)thisinput[0].value = this.textContent;
	if( thisinput[0].value.charAt(thisinput[0].value.length-1) == " ") thisinput[0].value =  thisinput[0].value.substr(0,  thisinput[0].value.length-1);//ie7下会末尾多一个空格，此处把空格去除
	/*if( thisinput[0].value!='Please select...') {
		thisinput[0].className = 'nav_select_s';
		if(this.id=='pro1'){temp1='';temp1=this.getAttribute("urlkey");}
		if(this.id=='pro2'){temp2=this.getAttribute("pro"); temp3=this.getAttribute("cat");}
	}
	 else  { thisinput[0].className = 'nav_select';}*/
    }
   }
  }else{
   ObjBlur();
  }
  thisObj.onblur = ObjBlur;
  function ObjBlur(){
thisObj.parentNode.className = 's_box';
   thisObj.id =  "";
   thisul[0].style.display = "none";
   thisObj.blur();
   }
 }
 
 function CoLeeSelect2(thisObj){   // the Select above the Navigator
 var thisinput = thisObj.getElementsByTagName("input");
 var thisul = thisObj.getElementsByTagName("ul");
 var thisli = thisul[0].getElementsByTagName("li");
 if(thisObj.id != "CoLeeSelect"){
  thisObj.id = "CoLeeSelect";
  thisObj.focus();
  thisul[0].style.display = "block";
  for(var i=0;i<thisli.length;i++){
   thisli[i].onmouseover = function(){
    for(var j=0;j<thisli.length;j++){
     // thisli[j].className = "";
	 //jQuery(this).removeClass("li_on");
	 if(thisli[j].className=='last_li')thisli[j].className = "last_li";
	 //  else if(thisli[j].className == 'last_li_on')thisli[j].className = 'last_li';
	     else thisli[j].className = "";
     }
	 this.className = "highlight";
	//jQuery(this).addClass("li_on");
	if(this.className=="last_li");//this.className = "last_li_on";
	  // else if(this.className == 'last_li_on')this.className = 'last_li';
	      else  this.className = "li_on";
    }
   thisli[i].onclick = function(){
    if(this.innerText)thisinput[0].value = this.innerText;
	if(this.textContent)thisinput[0].value = this.textContent;
	if( thisinput[0].value.charAt(thisinput[0].value.length-1) == " ") thisinput[0].value =  thisinput[0].value.substr(0,  thisinput[0].value.length-1);//ie7下会末尾多一个空格，此处把空格去除
	/*if( thisinput[0].value!='Please select...') {
		thisinput[0].className = 'nav_select_s';
		if(this.id=='pro1'){temp1='';temp1=this.getAttribute("urlkey");}
		if(this.id=='pro2'){temp2=this.getAttribute("pro"); temp3=this.getAttribute("cat");}
	}
	 else  { thisinput[0].className = 'nav_select';}*/
	if(thisObj.className=='moni_s nav_bellow_search swim-year'){
		if(thisinput[1]!=null){
			thisinput[1].value=this.id.substring(3,10);
			var maxdays = this.id.substring(11);
			var swimdayObj = document.getElementById('swim-day');
	
			var html = '';
			for(var i=1;i<=maxdays;i++){
				html += ' <li id="d-'+i+'" class=""><span>'+i+'</span></li>';
			}
			swimdayObj.innerHTML=html;
		}
    }else if(thisObj.className=='moni_s nav_bellow_search swim-day'){
		var target_date = document.getElementById('swim-date-year-month-value').value+'-'+this.id.substring(2);
		window.location.href = '?date='+target_date;
    }
   }
   }
  }else{
   ObjBlur();
  }
  thisObj.onblur = ObjBlur;
  function ObjBlur(){
   thisObj.id =  "";
   thisul[0].style.display = "none";
   thisObj.blur();
   }
 }
 
 function changeEvents(obj,currennum,totalnum){ // Home Page Calendar Events
		   for(var i=1;i<=totalnum;i++){			         
					 if(i!=currennum){
  	 			          document.getElementById('h_c_e_container_m_con_'+i).style.display="none";
						 }else{							 
							 document.getElementById('h_c_e_container_m_con_'+i).style.display="block";
							 }			   
			   }		
		}
 		
 function changeEvents2(obj,currennum,totalnum){ // Home Page - Blog Facebook Twitter  
           
		   var bpath = "";
		   bpath = jQuery('.h_calendar_events_container_t .facebook .h_c_e_nav_w img').attr("relpath");
		   for(var i=1;i<=totalnum;i++){			         
					 if(i!=currennum){
  	 			          document.getElementById('ha_c_e_container_m_con_'+i).style.display="none";						  
						 }else{							 							
							if(i==2){									
	//							newbg = tembg.replace("h_wi_fb_bg.png","h_wi_fb_bg_blue.png");
//								jQuery('.h_wi_fb').css("backgroundImage",newbg);
                                jQuery('#h_wi_fb').addClass('h_wi_fbblue');
								jQuery('#h_wi_fb').removeClass('h_wi_bgbg');
								jQuery('#h_wi_fb').removeClass('h_wi_blogblue');	
								jQuery('.h_calendar_events_container_t .facebook .h_c_e_nav_w img').attr("src",bpath+"/h_nav_fbook_hoverbg.png");
								jQuery('.h_wi_fb .h_calendar_events_container .h_calendar_events_container_m').css("overflow-y","scroll");
							}else if(i==1){
								jQuery('#h_wi_fb').addClass('h_wi_bgbg');								 
 							    jQuery('#h_wi_fb').removeClass('h_wi_fbblue');	
								jQuery('#h_wi_fb').removeClass('h_wi_blogblue');								
								jQuery('.h_calendar_events_container_t .facebook .h_c_e_nav_w img').attr("src",bpath+"/h_wi_fb_facebook_button.png");
								jQuery('.h_wi_fb .h_calendar_events_container .h_calendar_events_container_m').css("overflow-y","hidden");								
							}else if(i==3){	
								jQuery('#h_wi_fb').removeClass('h_wi_bgbg');						 
 							    jQuery('#h_wi_fb').removeClass('h_wi_fbblue');
								jQuery('#h_wi_fb').addClass('h_wi_blogblue');		
							}								 
							 document.getElementById('ha_c_e_container_m_con_'+i).style.display="block";							 
							 }			   
			   }		
		}
		
 function hpollresult(obj,currennum,totalnum){ // Home Page -- Daily Poll
		   for(var i=1;i<=totalnum;i++){			         
					 if(i==currennum){  						    
							document.getElementById('h_pooll_'+i).style.display="block";	
						 }else{										    
							 document.getElementById('h_pooll_'+i).style.display="none";
					 }			   
			   }		
}

/*************** 获取窗口大小 ***************/
var winWidth = 0;
var winHeight = 0;
function findDimensions() //函数：获取尺寸
{
//获取窗口宽度
if (window.innerWidth)
winWidth = window.innerWidth;
else if ((document.body) && (document.body.clientWidth))
winWidth = document.body.clientWidth;
//获取窗口高度
if (window.innerHeight)
winHeight = window.innerHeight;
else if ((document.body) && (document.body.clientHeight))
winHeight = document.body.clientHeight;
//通过深入Document内部对body进行检测，获取窗口大小
if (document.documentElement  && document.documentElement.clientHeight && document.documentElement.clientWidth)
{
winHeight = document.documentElement.clientHeight;
winWidth = document.documentElement.clientWidth;
}
//结果输出至两个文本框

}
findDimensions();
//调用函数，获取数值
window.onresize=findDimensions; 
//-->
function dome_pop_up(w,h,id,fullname,email){	
	WLeft_f2   =   Math.ceil((winWidth   -   w)   /   2  );
    WTop_f2   =   Math.ceil((winHeight   -   h)   /   2   ); 
	if(WTop_f2<0) WTop_f2=10;
	obj_f2 = document.getElementById(id);
    obj_f2.style.left = WLeft_f2 +"px";
    obj_f2.style.top =WTop_f2 +"px";

	var fullname = document.getElementById('fullname').value;
	var email = document.getElementById('email').value;
	if(fullname!='Enter Full Name')
	{
		document.getElementById('name').value = fullname;
	}

	if(email!='Enter Email Address')
	{
		document.getElementById('emailaddress').value = email;
	}
	

}

function dome_pop_show(obj,obj1,obj2){	        
   if(obj.checked==true){           	  
	   dome_show(obj1);
	}
	
}




 function getbyid(id){
	return document.getElementById(id);	
	}

function showUl(id){	
      getbyid(id).style.display="block";	  
	}
function hidUl(id){	
      getbyid(id).style.display="none";	  
	}		
	
function senddata(obj,vid,id,type){
	   var cdate = jQuery(obj).html();
	   var months = '';
	   var years = '';
	   jQuery(vid).val(cdate);		 

	   if(type=='m'){		
        	   months = cdate;
		       years = jQuery('#e_year_val').val();
			   
			   var isrun = false;
			   if(!(years%100)){
						   if(!((years/100)%4)){
							   isrun = true;
							   }
				   
				   }else{
					   if(!(years%4)){
							isrun = true;
						   }
					   }
			   switch(months){
					case "Dece":
					case "Janu":
					case "Marc":
					case "May":
					case "July":
					case "Augu":
					case "Octo":			
					jQuery("#e_day_ul").html(jQuery(".31dayscontainer").html());
					break;
					case "Apri":
					case "June":	
					case "Sept":
					case "Nove":	
					jQuery("#e_day_ul").html(jQuery(".30dayscontainer").html());
					break;
					case "Febr":
						 if(isrun){							  
								jQuery("#e_day_ul").html(jQuery(".29dayscontainer").html());
							 }else{
								jQuery("#e_day_ul").html(jQuery(".28dayscontainer").html());
								
								 }						
						break;
		
					default:		
				   }
		   
		}
		if(type=='y'){
			   years = cdate;
		       months = jQuery('#e_month_val').val();					 
			   var isrun = false;
			   if(!(years%100)){
						   if(!((years/100)%4)){
							    isrun = true;
							   }
				   
				   }else{
					   if(!(years%4)){
							isrun = true;
						   }
					   }					
			   switch(months){
					case "Dece":
					case "Janu":
					case "Marc":
					case "May":
					case "July":
					case "Augu":
					case "Octo":			
					jQuery("#e_day_ul").html(jQuery(".31dayscontainer").html());
					break;
					case "Apri":
					case "June":	
					case "Sept":
					case "Nove":	
					jQuery("#e_day_ul").html(jQuery(".30dayscontainer").html());
					break;
					case "Febr":
						 if(isrun){
								jQuery("#e_day_ul").html(jQuery(".29dayscontainer").html());
							 }
							 else{
								jQuery("#e_day_ul").html(jQuery(".28dayscontainer").html());
								 }						
						break;
		
					default:		
				   }	

	 }
	
        hidUl(id);		
	}	
	
function senddata_simple(liobj,ulid,inputid){
		 jQuery(inputid).val(jQuery(liobj).html());	 
		 hidUl(ulid);	
	}	

function addBookmark(title,url) {
      if (window.sidebar) {   window.sidebar.addPanel(title, url,"");  }
	     else if( document.all ) {

          window.external.AddFavorite( url, title);

               } else if( window.opera && window.print ) {
         return true;
}
}

